﻿using System;
using CodeFirst.Data;

namespace CodeFirst.Test
{
    static class TestSelect
    {
        private static void TestFind(int id)
        {
            using (var db = new BlogContext())
            {
                // ---------------- find existing one
                var blog = db.Blogs.Find(id);
                if (blog != null)
                {
                    Console.WriteLine("Found Blog Id={0},Title={1}", blog.Id, blog.Title);
                }
                else
                {
                    Console.WriteLine("!!! Cannot find Blog#{0}", id);
                }
            }
        }

        public static void TestMain()
        {
            TestFind(1);
            TestFind(100000);
        }// TestMain
    }
}
